#include <lpc23xx.h>
#include <RTL.h>
#include "LCD.h"

OS_TID  id1,id2,id3;

__task void task1(void);
__task void task2(void);

int main(void)
{
lcd_init();					   
lcd_clear();				  
set_cursor(0,0);			   
lcd_print("Suspend  Example");
FIO2DIR=0x000000FF;
os_sys_init_prio (task1,0x01);
	 
}
__task void task1(void){
   int i,j;
   id1 = os_tsk_self ();
   id2 = os_tsk_create (task2,0x01);
   
	while(1)
	{
	os_evt_set (0x0004, id2);
	os_evt_wait_or (0x0004, 0xffff);
	os_dly_wait (5);
	for(j=0;j<0x10;j++)
	{
	FIO2CLR=0x000000FF;
	FIO2SET=j;
	for(i=0;i<0xF0000;i++)
	{
		
	}
	}

	}

}
__task void task2(void){
	while(1)
	{
	os_evt_wait_or (0x0004, 0xffff);
	FIO2SET=0x000000F0;
	FIO2CLR=0x0000000F;
	os_dly_wait (20);
	os_evt_set (0x0004, id1);	
	//os_dly_wait(50);

	}

}
